package com.lizx.framework.web.demo2;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author: lizx
 * @Description:
 * @Date: Create in 2019/1/17 2:55 PM
 */
public class SimpleServletInit extends HttpServlet {
    private static String dbService = null;
    @Override
    public void init() throws ServletException {
        dbService = "world";
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        req.setAttribute("hello", dbService);
        req.getRequestDispatcher("/WEB-INF/demo2/jsp/hello.jsp").forward(req, resp);
    }
}
